const state = {
    tabId: '' // 存储当前选中的 tabId
}

const mutations = {
    SET_TAB_ID(state, tabId) {
        state.tabId = tabId
    }
}

const actions = {
    setTabId({ commit }, tabId) {
        commit('SET_TAB_ID', tabId)
    }
}

const getters = {
    tabId: state => state.tabId
}

export default {
    namespaced: true, // 开启命名空间，推荐
    state,
    mutations,
    actions,
    getters
}